/**
 * Copyright (c) 2015 Baidu. All Rights Reserved.
 *
 * @file HTTP请求工具单测
 * @author yuanguozheng
 */
var requester = require('../utils/requester');
var RequestModel = require('../models/request_model');

exports.testRequester = function (test) {
    var reqModel = new RequestModel();
    reqModel.url = 'http://baidu.com';
    requester.doReq(reqModel, function (res) {
        test.notEqual(null, res);
        test.done();
    });
    var errReqModel = new RequestModel();
    errReqModel.url = null;
    requester.doReq(errReqModel, function (res) {
        test.equal(null, res);
        test.done();
    });
};